<?php
session_start();
include "Includes/solotrn_sesion.php";
include "Includes/soloFun_Generales.php";

$CboNodo = $_REQUEST["CboNodo"];
$opcion = $_REQUEST["Opcion"];
switch($opcion) {
    case 2:
        $boton = "<input type='button' name='Submit' class='SoloStyle_Boton' value='Eliminar' onClick='EliminaPerfil();'>";
        $Titulo = "Eliminar Usuario";
        $Oculto = "<input type='hidden' name='Opcion' value='2'>";
}

$strsql = "select * from solotb_usuario ";
$strsql .= " where nu_usua= {$_REQUEST["txtCodigo"]} and nodo = {$_REQUEST["CboNodo"]}";
//   'rw "sql",strsql
//   're
SoloFun_ExecSql ($strsql, $ArrUsuario);

$strsql= "select * from solotb_nodos";
SoloFun_ExecSql ($strsql, $SoloArrNodos);
//'rw "",SoloArrNodos(1,0)
//   're
$StrCboNodo = SoloFun_CargaCombo($SoloArrNodos,"CboNodo","CboDisabled",$itemselec," class='SoloStyle_Texto' style='width:200'","");

/********************Inicio de Consulta de perfiles****************************/
$strSql = "select * from solotb_perfil ";
if (!empty($CboNodo))
    $strsql .= "where nodo = $CboNodo";

$strsql .= " order by ds_perf, nodo asc";
SoloFun_ExecSql ($strSQL, $ArrPerfil);

$itemselec = $ArrUsuario[0][5];
if (!empty($_REQUEST["CmbPerfil"])) $itemselec = $_REQUEST["CmbPerfil"];
$StrCboPerfil = SoloFun_CargaCombo($ArrPerfil,"CmbPerfil","$CboDisabled",$itemselec," class='SoloStyle_Texto' style='width:200'","");
?>
<html>
    <head>
        <title>SoloPortal - Eliminar Usuarios</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link rel="stylesheet" href="SoloStyles/Solostyles.css" type="text/css">
        <SCRIPT type="text/JavaScript" src="Includes/Solofun_generales.js"></SCRIPT>
    </head>
    <body topmargin="0" leftmargin="0" onkeydown="checkKey();">

        <img src="templates/SoloTemplate_LogoCabecera.png" style="height: 50px"/>
        <p align="center" class="SoloStyle_TituloPaginas"><?php echo $Titulo;?></p>

        <form name="frm" action="solotrn_GrabarUsuario.php?CboNodo=<?php echo $_REQUEST["CboNodo"]; ?>" method="POST">
            <?php echo $Oculto; ?>
            <table border="0" width="90%" align="center" cellpadding="2" cellspacing="1" bordercolor="#CCCCCC">
                <tr>
                    <td> <img src="iconos/soloico_eliminar.gif" border="1" alt="Eliminar Usuario" style="cursor:hand" onClick="frm.submit();">
                        <img src="iconos/soloico_salir.gif" border="1" alt="Regresar" style="cursor:hand" onClick="window.opener.location.reload();window.close();" >
                    </td>
            </table>
            <table border="0" width="90%" bordercolor="#CCCCCC" cellpadding="2" cellspacing="1" align="center">
                <tr>
                    <td class="SoloStyle_Etiqueta" width="25%">Nodo</td>
                    <td  class="SoloStyle_EtiquetaCajas" width="75%"><?php echo $StrCboNodo;?></td>
                </tr>
                <tr>
                    <td class="SoloStyle_Etiqueta" width="25%"><b>Id Usuario</b></td>
                    <td class="SoloStyle_EtiquetaCajas" width="75%"><?php echo $ArrUsuario[0][0];?>
                        <input type="hidden" name="txtCodigo"  maxlength="8" size="12" value="<?php echo $ArrUsuario[0][0]; ?>" class="SoloStyle_Texto" readonly="true">

                    </td>
                </tr>
                <tr>
                    <td class="SoloStyle_Etiqueta"><b>Nombre</b> </td>
                    <td class="SoloStyle_EtiquetaCajas">
                        <input type="text" maxlength="50" size="43" name="ATxtNombre" class="SoloStyle_Texto" value="<?php echo Str2ProperCase($ArrUsuario[0][2]);?>">
                    </td>
                </tr>
                <tr>
                    <td class="SoloStyle_Etiqueta"><b>Usuario</b> </td>
                    <td class="SoloStyle_EtiquetaCajas">
                        <input type="text" maxlength="20" size="12" name="ATxtUsuario" class="SoloStyle_Texto" value="<?php echo $ArrUsuario[0][1];?>">
                    </td>
                </tr>
                <tr>
                <input type="hidden" maxlength="12" size="12" name="ATxtClave" class="SoloStyle_Texto"  value="<?php echo $ArrUsuario[0][3];?>">
                </tr>
            </table>
            <br>
        </form>
    </body>
</html>
<script type="text/JavaScript">

    function EliminaPerfil(){
        var truthBeTold = window.confirm(acentos("¿Está seguro que desea eliminar el Perfil seleccionado?"));
        if (truthBeTold) {
            frm.hidElimina.value='Y';
            frm.submit();
        }
    }
</script>
<?php
include "Includes/soloFun_ShowMessages.php";
?>
